using AgentFrameworkDemo.Models;

namespace AgentFrameworkDemo.Services;

/// <summary>
/// 工具执行器接口
/// </summary>
public interface IToolExecutor
{
    /// <summary>
    /// 工具类型
    /// </summary>
    ToolType ToolType { get; }

    /// <summary>
    /// 获取可用工具列表
    /// </summary>
    /// <param name="agentId">Agent ID</param>
    /// <returns>工具定义列表</returns>
    Task<List<ToolDefinition>> GetAvailableToolsAsync(string? agentId = null);

    /// <summary>
    /// 执行工具
    /// </summary>
    /// <param name="request">工具执行请求</param>
    /// <returns>工具执行结果</returns>
    Task<ToolExecutionResult> ExecuteToolAsync(ToolExecutionRequest request);

    /// <summary>
    /// 验证工具参数
    /// </summary>
    /// <param name="toolId">工具ID</param>
    /// <param name="parameters">参数字典</param>
    /// <returns>验证结果</returns>
    Task<(bool isValid, List<string> errors)> ValidateParametersAsync(string toolId, Dictionary<string, object> parameters);

    /// <summary>
    /// 检查工具是否可用
    /// </summary>
    /// <param name="toolId">工具ID</param>
    /// <returns>是否可用</returns>
    Task<bool> IsToolAvailableAsync(string toolId);

    /// <summary>
    /// 获取工具信息
    /// </summary>
    /// <param name="toolId">工具ID</param>
    /// <returns>工具定义</returns>
    Task<ToolDefinition?> GetToolDefinitionAsync(string toolId);
}